<?php
namespace app\api\validate;

use think\Validate;

class NoticeValidate extends Validate
{
    protected $rule =   [
        'device_code'  => 'require',
        'title'  => 'require',
        'class_ids'     => 'require|array',
        'images'         =>'array',
        'platform'         =>'require',
        'user_id'         =>'require',
        'school_id'         =>'require',
    ];
    
    protected $message  =   [
        'device_code.require' => '设备id必须填写',
        'title.require' => 'title标题必须填写',
        'class_ids.require' => 'class_ids班级id至少填写一个',
        'class_ids.array' => 'class_ids班级id必须是数组',
        'images.array' => 'images图集必须是数组',
        'platform.require' => 'platform平台必须填写',
        'user_id.require' => 'user_id用户id必须填写',
        'school_id.require' => 'school_id学校id必须填写',
    ];
    
    protected $scene = [
        'view'  =>  ['device_code'],
        'app_validate'=>['title','class_ids','platform','user_id','school_id','images']
    ];
}
